class stu_resource:
	name 		=['taowei', 'wulaijun']
	ident 	=[	'001', 		'002']
	chinese	=[		77,				82 ]
	math		=[		97,				66 ]
	english	=[		87,				86 ]
	sum			=[		261,		 234 ]
	
	def __init__(self):
		print 'initialize'

	def find_position_by_name(self, name_str):
		position = 0
		for i in self.name:
			if i != name_str:
				position += 1
				continue
			else:
				break
		return position

	def print_data_by_num(self, num): 
		print self.name[num],self.ident[num],self.chinese[num],self.math[num],self.english[num], self.sum[num]

	def print_data_by_name(self, name_str):
		position = self.find_position_by_name(name_str)
		print self.name[position],self.ident[position],self.chinese[position],self.math[position],self.english[position], self.sum[position]

	def print_data(self):
		data_len = len(self.name)
		for i in range(0,data_len):
			print self.name[i],self.ident[i],self.chinese[i],self.math[i],self.english[i], self.sum[i]
		

	def add_data(self, lname, lident, lchinese, lmatch, lenglish):
		self.name.append(lname)
		self.ident.append(lident)
		self.chinese.append(lchinese)
		self.math.append(lmatch)
		self.english.append(lenglish)
		self.sum.append(lchinese + lmatch + lenglish)

	def del_data_by_num(self, num):
		del self.name[num]
		del self.ident[num]
		del self.chinese[num]
		del self.math[num]
		del self.english[num]
		del self.sum[num]
		
	def del_data_by_name(self, name_str):
		position = self.find_position_by_name(name_str)
		del self.name[position]
		del self.ident[position]
		del self.chinese[position]
		del self.math[position]
		del self.english[position]
		del self.sum[position]
	


